﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ReturnToFactoryRepairAndQuoate.aspx.cs" Inherits="WXYW.ReturnToFactoryRepairAndQuoate" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    返厂 - 维修及报价
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ButtonPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContentPlaceHolder" runat="server">
    <div class="buttonHeader" align="right">
        <img src="image/operateicon/back_back.gif" alt="" /><asp:HyperLink ID="HyperLink1"
            runat="server" NavigateUrl="~/ReturnToFactoryNeedMaintain.aspx">返回</asp:HyperLink>&nbsp;
        <img src="image/operateicon/check.gif" alt="" /><asp:LinkButton ID="saveLinkButton"
            runat="server" OnClick="saveLinkButton_Click" OnClientClick='javascript: return confirm("确定要保存吗?")'>保存</asp:LinkButton></div>
    <table style="width: 100%; line-height:25px">
        <tr style="height: 25px">
            <td colspan="5" style="border-bottom-style: solid; border-bottom-width: 1px;">
                <b>供应商信息</b>
            </td>
        </tr>
        <tr style="height: 25px">
            <td style="width: 10%">
                供应商名称:
            </td>
            <td style="width:35%;border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="providerNameLabel" runat="server" Text=""></asp:Label>
            </td>
            <td style="width: 10%"></td>
            <td style="width: 10%">
                联系人:
            </td>
            <td style="width:35%;border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="connectPersonLabel" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                代码:
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="proviceCodeLabel" runat="server" Text=""></asp:Label>
            </td>
            <td></td>
            <td>
                返厂流水号:
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="rtfRunningNumberLabel" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr style="height: 25px">
            <td>
                通讯地址:
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="addressLabel" runat="server" Text=""></asp:Label>
            </td>
            <td></td>
            <td>
                联系电话:
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="phoneNumberLabel" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr style="height: 25px">
            <td>
                合作状态:
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="workStatusLabel" runat="server" Text=""></asp:Label>
            </td>
            <td></td>
            <td>
                联系手机:
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="cellPhoneLabel" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>
    <table style="width: 100%; line-height:25px">
        <tr style="height: 25px">
            <td colspan="8" style="border-bottom-style: solid; border-bottom-width: 1px;">
                <b>客户信息</b>
            </td>
        </tr>
        <tr>
            <td style="width: 10%">
                RMA#:
            </td>
            <td style="width:35%;border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="rmaCodeLabel" runat="server" Text=""></asp:Label>
            </td>
            <td style="width: 10%"></td>
            <td style="width: 10%">
                申请人:
            </td>
            <td style="width:35%;border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="applicantLabel" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                联系电话：
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="applicantPhoneLabel" runat="server" Text=""></asp:Label>
            </td>
            <td></td>
            <td>
                电子邮件:
            </td>            
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="applicantEmailLabel" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>
    <table style="width: 100%" class="tableList">
        <tr style="height: 25px">
            <td colspan="8" style="border-bottom-style: solid; border-bottom-width: 1px;">
                <b>产品信息</b>
            </td>
        </tr>
        <tr style="height: 25px">
            <th>
                产品型号
            </th>
            <th>
                序列号
            </th>
            <th>
                版本号
            </th>
            <th>
                故障描述
            </th>
            <th>
                保修性质
            </th>
            <th>
                收货日期
            </th>
            <th>
                操作
            </th>
        </tr>
        <tr style="height: 25px">
            <td>
                <asp:Label ID="productTypeLabel" runat="server" Text=""></asp:Label>
            </td>
            <td>
                <asp:Label ID="productSerialNumberLabel" runat="server" Text=""></asp:Label>
            </td>
            <td>
                <asp:Label ID="versionLabel" runat="server" Text=""></asp:Label>
            </td>
            <td>
                <asp:Label ID="problemDescriptionLabel" runat="server" Text=""></asp:Label>
            </td>
            <td>
                <asp:Label ID="repairStatusLbl" runat="server" Text=""></asp:Label>
            </td>
            <td>
                <asp:Label ID="receiveTimeLabel" runat="server" Text=""></asp:Label>
            </td>
            <td>
                <%--<img src="image/icon16_n.png" alt="" /><asp:LinkButton ID="repairLinkButton" runat="server"
                    CommandArgument='<%#Eval("ApplicationProductID") %>' OnClick="repairLinkButton_Click">维修记录</asp:LinkButton>&nbsp;--%>
                <asp:LinkButton ID="factoryQuotePriceLinkButton" runat="server" CommandArgument='<%#Eval("ApplicationProductID") %>'
                    OnClick="factoryQuotePriceLinkButton_Click">工厂报价</asp:LinkButton>&nbsp;
                <asp:LinkButton ID="customerQuotrPriceLnkBtn" runat="server" CommandArgument='<%#Eval("ApplicationProductID") %>'
                    OnClick="customerQuotrPriceLnkBtn_Click">客户报价</asp:LinkButton>
            </td>
        </tr>
    </table>
    <asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" />
    <%--客户报价--%>
    <cc1:ModalPopupExtender ID="quatationModalPopupExtender" runat="server" PopupControlID="quetationPanel"
        BackgroundCssClass="modalBackground" TargetControlID="hiddenTargetControlForModalPopup"
        Drag="true" PopupDragHandleControlID="QuatationDragBar" CancelControlID="cancelLinkButton">
    </cc1:ModalPopupExtender>
    <asp:Panel ID="quetationPanel" Style="display: none" runat="server" BackImageUrl="~/image/mainSkinBG.gif"
        CssClass="modalPopup" Width="600px">
        <!-- Header -->
        <div class="box-header" id="QuatationDragBar">
            <img src="image/stdBox_left_top.gif" alt="" />
            <h2>
                维修报价</h2>
        </div>
        <div class="functionPanel">
            <table width="100%">
                <tr style="height: 25px">
                    <td style="width: 10%">
                        <b>RMA#:</b>
                    </td>
                    <td style="width: 20%">
                        <asp:Label ID="rmaLabel" runat="server" Text=""></asp:Label>
                    </td>
                    <td style="width: 15%">
                        <b>产品型号:</b>
                    </td>
                    <td style="width: 25%;">
                        <asp:Label ID="serialNumberLabel" runat="server" Text=""></asp:Label>
                    </td>
                    <td style="width: 10%">
                        <b>版本号:</b>
                    </td>
                    <td style="width: 10%">
                        <asp:Label ID="versionNUmberLabel" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:DropDownList ID="customerQuatationReasonDDL" runat="server">
                        </asp:DropDownList>
                        <span style="color: Red">*</span>
                    </td>
                    <td>
                        <b>不良现象:</b>
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="blxxTxtBox" runat="server" TextMode="MultiLine" Width="90%" Rows="2"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <table width="100%" class="tableList">
                <tr>
                    <th style="width: 30%">
                        零件名
                    </th>
                    <th style="width: 20%">
                        单价
                    </th>
                    <th style="width: 15%">
                        个数
                    </th>
                    <th style="width: 20%">
                        保外备案
                    </th>
                    <th style="width: 15%">
                        操作
                    </th>
                </tr>
            </table>
            <asp:UpdatePanel ID="quatationFormUpdatePanel" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="CustomerQuatationGridView" runat="server" AutoGenerateColumns="False"
                        Width="100%" CssClass="tableList" OnRowDataBound="CustomerQuatationGridView_RowDataBound"
                        ShowHeader="False">
                        <Columns>
                            <asp:BoundField HeaderText="零件名" DataField="AccessoryName">
                                <ItemStyle Width="30%" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="单价">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("UnitPrice") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <%# Math.Round(Convert.ToDecimal(Eval("UnitPrice")), 2)%>
                                </ItemTemplate>
                                <ItemStyle Width="20%" />
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="个数" DataField="Count">
                                <ItemStyle Width="15%" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="保外备案" DataField="IsBWBA">
                                <ItemStyle Width="20%" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate>
                                    <asp:LinkButton ID="deleteLinkButton" runat="server" CommandArgument='<%#Eval("ID") %>'
                                        OnClick="deleteLinkButton_Click">删除</asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle Width="15%" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <table style="width: 100%" class="tableList">
                        <tr style="height: 5px">
                            <td colspan="5">
                            </td>
                        </tr>
                        <tr style="height: 25px">
                            <td style="width: 30%">
                                <asp:TextBox ID="CustomerQuatationAccessoryTxtBox" runat="server" autocomplete="off"
                                    AutoPostBack="true" Width="80%" OnTextChanged="CustomerQuatationAccessoryTxtBox_TextChanged"></asp:TextBox><asp:Label
                                        ID="startLbl1" runat="server" Text="*" ForeColor="Red"></asp:Label>
                                <asp:RequiredFieldValidator ID="AccessoryNameRequiredValidator" runat="server" ErrorMessage=""
                                    Text="" ControlToValidate="CustomerQuatationAccessoryTxtBox" ValidationGroup="NewAccessoryPriceValidation"></asp:RequiredFieldValidator>
                                <cc1:AutoCompleteExtender ID="AutoCompleteExtender7" runat="server" TargetControlID="CustomerQuatationAccessoryTxtBox"
                                    CompletionInterval="1000" MinimumPrefixLength="1" ServicePath="WXYWService.asmx"
                                    ServiceMethod="GetAccessoryOfProvider" CompletionListCssClass="autocomplete_completionListElement"
                                    CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                    EnableCaching="true">
                                </cc1:AutoCompleteExtender>
                            </td>
                            <td style="width: 20%">
                                <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                                    <ContentTemplate>
                                        ￥:<asp:TextBox ID="CustomerQuataionAccessoryPriceTxtBox" runat="server" Width="30%" ReadOnly="true"></asp:TextBox>元<asp:Label
                                            ID="startLbl2" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:RequiredFieldValidator
                                                ID="AccessoryPriceRequiredFieldValidator" runat="server" ErrorMessage="" Text=""
                                                ControlToValidate="CustomerQuataionAccessoryPriceTxtBox" ValidationGroup="NewAccessoryPriceValidation"></asp:RequiredFieldValidator>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="CustomerQuatationAccessoryTxtBox" EventName="TextChanged" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </td>
                            <td style="width: 15%">
                                <asp:DropDownList ID="CustomerQuatationCountDDL" runat="server">
                                    <asp:ListItem Text="1" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="2" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="3" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="4" Value="4"></asp:ListItem>
                                    <asp:ListItem Text="5" Value="5"></asp:ListItem>
                                    <asp:ListItem Text="6" Value="6"></asp:ListItem>
                                    <asp:ListItem Text="7" Value="7"></asp:ListItem>
                                    <asp:ListItem Text="8" Value="8"></asp:ListItem>
                                    <asp:ListItem Text="9" Value="9"></asp:ListItem>
                                    <asp:ListItem Text="10" Value="10"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="width: 20%">
                                <asp:CheckBox ID="isBWBACheckBox" runat="server" />
                            </td>
                            <td style="width: 15%">
                                <asp:Button ID="CustomerQuatationAddAccessoryButton" runat="server" Text="添加" OnClick="CustomerQuatationAddAccessoryButton_Click"
                                    Width="90%" />
                            </td>
                        </tr>
                        <tr style="height: 5px">
                            <td colspan="5">
                                <asp:Label ID="CustomerQuatationTipLbl" runat="server" Text="" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
            <div style="text-align: center">
                <img src="image/operateicon/docdelete.gif" alt="" />
                <asp:LinkButton ID="cancelLinkButton" runat="server">关闭</asp:LinkButton>
                <img src="image/operateicon/check.gif" alt="" />
                <asp:LinkButton ID="saveCustomerQuatationLnkBtn" runat="server" OnClick="saveCustomerQuatationLnkBtn_Click">保存</asp:LinkButton>
            </div>
        </div>
        <div class="box-footer">
            <img alt="" src="image/stdBox_left_bottom.gif" />
            <p>
                &nbsp;</p>
        </div>
    </asp:Panel>
    <%--工厂报价--%>
    <cc1:ModalPopupExtender ID="factoryQuatationModalPopupExtender" runat="server" PopupControlID="FactoryQuatationPanel"
        BackgroundCssClass="modalBackground" TargetControlID="hiddenTargetControlForModalPopup"
        Drag="true" PopupDragHandleControlID="factoryQuatationBar" CancelControlID="closeFactoryQuatationBtn">
    </cc1:ModalPopupExtender>
    <asp:Panel ID="FactoryQuatationPanel" Style="display: none" runat="server" BackImageUrl="~/image/mainSkinBG.gif"
        CssClass="modalPopup" Width="600px">
        <!-- Header -->
        <div class="box-header" id="factoryQuatationBar">
            <img src="image/stdBox_left_top.gif" alt="" />
            <h2>
                返厂工厂报价</h2>
        </div>
        <div class="functionPanel">
            <table width="100%">
                <tr style="height: 25px">
                    <td style="width: 10%">
                        <b>RMA#:</b>
                    </td>
                    <td style="width: 20%">
                        <asp:Label ID="factoryRMALbl" runat="server" Text=""></asp:Label>
                    </td>
                    <td style="width: 15%">
                        <b>产品型号:</b>
                    </td>
                    <td style="width: 25%">
                        <asp:Label ID="factoryProductModelNOLbl" runat="server" Text=""></asp:Label>
                    </td>
                    <td style="width: 10%">
                        <b>版本号:</b>
                    </td>
                    <td style="width: 10%">
                        <asp:Label ID="factoryVersionNOLbl" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
            </table>
            <table width="100%">
                <tr>
                    <td style="width: 30%; text-align: center">
                        <asp:DropDownList ID="factoryQuatationReasonDDL" runat="server" Width="150px">
                        </asp:DropDownList>
                        <span style="color: Red">*</span>
                    </td>
                    <td style="width: 20%">
                    </td>
                    <td style="width: 25%">
                    </td>
                    <td style="width: 15%">
                    </td>
                </tr>
            </table>
            <table width="100%" class="tableList">
                <tr>
                    <th style="width: 50%">
                        零件名
                    </th>
                    <th style="width: 20%">
                        单价
                    </th>
                    <th style="width: 15%">
                        个数
                    </th>
                    <th style="width: 15%">
                        操作
                    </th>
                </tr>
            </table>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="factoryQuatationGridView" runat="server" AutoGenerateColumns="False"
                        Width="100%" CssClass="tableList" OnRowDataBound="factoryQuatationGridView_RowDataBound"
                        ShowHeader="False">
                        <Columns>
                            <asp:BoundField HeaderText="零件名" DataField="AccessoryName">
                                <ItemStyle Width="50%" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="单价">
                                <EditItemTemplate>
                                    ￥:<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("UnitPrice") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    ￥:<%# Math.Round(Convert.ToDecimal(Eval("UnitPrice")), 2)%>
                                </ItemTemplate>
                                <ItemStyle Width="20%" />
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="个数" DataField="Count">
                                <ItemStyle Width="15%" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate>
                                    <asp:LinkButton ID="factoryDeleteQuatationLnkBtn" runat="server" CommandArgument='<%#Eval("ID") %>'
                                        OnClick="factoryDeleteQuatationLnkBtn_Click">删除</asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle Width="15%" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <table style="width: 100%" class="tableList">
                        <tr style="height: 5px">
                            <td colspan="5">
                            </td>
                        </tr>
                        <tr style="height: 25px">
                            <td style="width: 50%">
                                <asp:TextBox ID="factoryQuatationAccessoryTxtBox" runat="server" autocomplete="off"
                                    AutoPostBack="true" Width="80%" OnTextChanged="factoryQuatationAccessoryTxtBox_TextChanged"></asp:TextBox><asp:Label
                                        ID="Label5" runat="server" Text="*" ForeColor="Red"></asp:Label>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage=""
                                    Text="" ControlToValidate="factoryQuatationAccessoryTxtBox" ValidationGroup="NewFactoryAccessoryPriceValidation"></asp:RequiredFieldValidator>
                                <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="factoryQuatationAccessoryTxtBox"
                                    CompletionInterval="1000" MinimumPrefixLength="1" ServicePath="WXYWService.asmx"
                                    ServiceMethod="GetAccessoryOfProvider" CompletionListCssClass="autocomplete_completionListElement"
                                    CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                    EnableCaching="true">
                                </cc1:AutoCompleteExtender>
                            </td>
                            <td style="width: 20%">
                                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                    <ContentTemplate>
                                        ￥:<asp:TextBox ID="factoryQuatationPriceTxtBox" runat="server" Width="30%" ReadOnly="true"></asp:TextBox>元<asp:Label
                                            ID="Label6" runat="server" Text="*" ForeColor="Red"></asp:Label><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator2" runat="server" ErrorMessage="" Text="" ControlToValidate="factoryQuatationPriceTxtBox"
                                                ValidationGroup="NewFactoryAccessoryPriceValidation"></asp:RequiredFieldValidator>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="factoryQuatationAccessoryTxtBox" EventName="TextChanged" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </td>
                            <td style="width: 15%">
                                <asp:DropDownList ID="factoryQuatationCountDDL" runat="server">
                                    <asp:ListItem Text="1" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="2" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="3" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="4" Value="4"></asp:ListItem>
                                    <asp:ListItem Text="5" Value="5"></asp:ListItem>
                                    <asp:ListItem Text="6" Value="6"></asp:ListItem>
                                    <asp:ListItem Text="7" Value="7"></asp:ListItem>
                                    <asp:ListItem Text="8" Value="8"></asp:ListItem>
                                    <asp:ListItem Text="9" Value="9"></asp:ListItem>
                                    <asp:ListItem Text="10" Value="10"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="width: 15%">
                                <asp:Button ID="factoryAddQuatationBtn" runat="server" Text="添加" OnClick="factoryAddQuatationBtn_Click"
                                    Width="90%" ValidationGroup="NewFactoryAccessoryPriceValidation" />
                            </td>
                        </tr>
                        <tr style="height: 5px">
                            <td colspan="5">
                                <asp:Label ID="factoryTipLbl" runat="server" Text="" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
            <div style="text-align: center">
                <img src="image/operateicon/docdelete.gif" alt="" />
                <asp:LinkButton ID="closeFactoryQuatationBtn" runat="server">关闭</asp:LinkButton>
                <img src="image/operateicon/check.gif" alt="" />
                <asp:LinkButton ID="saveFactoryQuatationBtn" runat="server" OnClick="saveFactoryQuatationBtn_Click">保存</asp:LinkButton>
            </div>
        </div>
        <div class="box-footer">
            <img alt="" src="image/stdBox_left_bottom.gif" />
            <p>
                &nbsp;</p>
        </div>
    </asp:Panel>    
</asp:Content>
